#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：Employment_class 
@File    ：03_udp绑定端口.py
@IDE     ：PyCharm 
@Author  ：XiaoDengYa
@Date    ：2021/7/5/005 14:28 
"""

from socket import *

udpSocket = socket(AF_INET, SOCK_DGRAM)

bindAddr = ("",7788)
udpSocket.bind(bindAddr)

recvData = udpSocket.recvfrom(1024)

print("%s:%s"%(recvData[1], recvData[0].decode("gb2312")))

udpSocket.close()